This repository was archived by the owner on Jul 15, 2024. It is now read-only.
feat: refresh rewards automation#34
Open
brotherlymite wants to merge 15 commits into
Open
Conversation
|
Foundry report forge 0.2.0 (7bfe5bf 2023-04-05T00:04:39.653167838Z)Build loginstalling solc version "0.8.10"
Successfully installed solc 0.8.10
Compiling 100 files with 0.8.10
Solc 0.8.10 finished in 9.66s
Compiler run successful (with warnings)
�[33mwarning[2519]: �[0m�[33mWarning: This declaration shadows an existing declaration.
--> lib/aave-v3-core/contracts/protocol/tokenization/base/IncentivizedERC20.sol:74:5:
|
74 | string memory name,
| ^^^^^^^^^^^^^^^^^^
Note: The shadowed declaration is here:
--> lib/aave-v3-core/contracts/protocol/tokenization/base/IncentivizedERC20.sol:86:3:
|
86 | function name() public view override returns (string memory) {
| ^ (Relevant source part starts here and spans across multiple lines).
�[0m
�[33mwarning[8760]: �[0m�[33mWarning: This declaration has the same name as another declaration.
--> lib/aave-v3-core/contracts/protocol/tokenization/base/IncentivizedERC20.sol:75:5:
|
75 | string memory symbol,
| ^^^^^^^^^^^^^^^^^^^^
Note: The other declaration is here:
--> lib/aave-v3-core/contracts/protocol/tokenization/base/IncentivizedERC20.sol:91:3:
|
91 | function symbol() external view override returns (string memory) {
| ^ (Relevant source part starts here and spans across multiple lines).
�[0m
�[33mwarning[8760]: �[0m�[33mWarning: This declaration has the same name as another declaration.
--> lib/aave-v3-core/contracts/protocol/tokenization/base/IncentivizedERC20.sol:76:5:
|
76 | uint8 decimals
| ^^^^^^^^^^^^^^
Note: The other declaration is here:
--> lib/aave-v3-core/contracts/protocol/tokenization/base/IncentivizedERC20.sol:96:3:
|
96 | function decimals() external view override returns (uint8) {
| ^ (Relevant source part starts here and spans across multiple lines).
�[0m
�[33mwarning[5667]: �[0m�[33mWarning: Unused function parameter. Remove or comment out the variable name to silence this warning.
--> src/StaticATokenLM.sol:538:59:
|
538 | function _beforeTokenTransfer(address from, address to, uint256 amount) internal override {
| ^^^^^^^^^^^^^^
�[0m
�[33mwarning[2072]: �[0m�[33mWarning: Unused local variable.
--> tests/StaticATokenLM.t.sol:237:5:
|
237 | uint256 claimable = staticATokenLM.getClaimableRewards(user, REWARD_TOKEN());
| ^^^^^^^^^^^^^^^^^
�[0m
�[33mwarning[2018]: �[0m�[33mWarning: Function state mutability can be restricted to view
--> tests/StaticATokenLM.t.sol:26:3:
|
26 | function REWARD_TOKEN() public returns (address) {
| ^ (Relevant source part starts here and spans across multiple lines).
�[0m
�[33mwarning[2018]: �[0m�[33mWarning: Function state mutability can be restricted to view
--> tests/StaticATokenMetaTransactions.sol:25:3:
|
25 | function REWARD_TOKEN() public returns (address) {
| ^ (Relevant source part starts here and spans across multiple lines).
�[0m
�[33mwarning[2018]: �[0m�[33mWarning: Function state mutability can be restricted to view
--> tests/StaticATokenNoLM.t.sol:23:3:
|
23 | function REWARD_TOKEN() public returns (address) {
| ^ (Relevant source part starts here and spans across multiple lines).
�[0m
| Contract | Size (kB) | Margin (kB) |
|-----------------------------|-----------|-------------|
| AToken | 10.309 | 14.267 |
| AaveGovernanceV2 | 0.272 | 24.304 |
| AaveMisc | 0.086 | 24.49 |
| AaveV3Arbitrum | 0.086 | 24.49 |
| AaveV3ArbitrumAssets | 0.086 | 24.49 |
| AaveV3Avalanche | 0.086 | 24.49 |
| AaveV3AvalancheAssets | 0.086 | 24.49 |
| AaveV3Ethereum | 0.086 | 24.49 |
| AaveV3EthereumAssets | 0.086 | 24.49 |
| AaveV3Optimism | 0.086 | 24.49 |
| AaveV3OptimismAssets | 0.086 | 24.49 |
| AaveV3Polygon | 0.086 | 24.49 |
| AaveV3PolygonAssets | 0.086 | 24.49 |
| Address | 0.086 | 24.49 |
| ConfiguratorInputTypes | 0.086 | 24.49 |
| DataTypes | 0.086 | 24.49 |
| DeployATokenFactory | 0.086 | 24.49 |
| ERC1967Proxy | 0.708 | 23.868 |
| Errors | 4.399 | 20.177 |
| GPv2SafeERC20 | 0.086 | 24.49 |
| MathUtils | 0.086 | 24.49 |
| ProxyAdmin | 1.69 | 22.886 |
| RayMathExplicitRounding | 0.086 | 24.49 |
| RefreshRobotKeeper | 3.292 | 21.284 |
| ReserveConfiguration | 0.171 | 24.405 |
| RewardsDataTypes | 0.086 | 24.49 |
| SafeCast | 0.086 | 24.49 |
| SafeERC20 | 0.086 | 24.49 |
| SigUtils | 1.706 | 22.87 |
| StaticATokenErrors | 0.611 | 23.965 |
| StaticATokenFactory | 3.689 | 20.887 |
| StaticATokenLM | 17.275 | 7.301 |
| StdInvariant | 2.048 | 22.528 |
| StorageSlot | 0.086 | 24.49 |
| TransparentProxyFactory | 7.595 | 16.981 |
| TransparentUpgradeableProxy | 2.161 | 22.415 |
| WadRayMath | 0.086 | 24.49 |
| console | 0.086 | 24.49 |
| console2 | 0.086 | 24.49 |
| stdError | 0.598 | 23.978 |
| stdJson | 0.086 | 24.49 |
| stdMath | 0.086 | 24.49 |
| stdStorage | 0.086 | 24.49 |
| stdStorageSafe | 0.086 | 24.49 |Test success 🌈No files changed, compilation skipped
Running 2 tests for tests/RefreshRobotKeeper.t.sol:RefreshRobotKeeperTest
�[32m[PASS]�[0m testAdmin() (gas: 21414)
�[32m[PASS]�[0m testRefreshRewards() (gas: 1309416)
Test result: �[32mok�[0m. 2 passed; 0 failed; finished in 150.93ms
Running 5 tests for tests/StaticATokenMetaTransactions.sol:StaticATokenMetaTransactions
�[32m[PASS]�[0m testAdmin() (gas: 21458)
�[32m[PASS]�[0m test_metaDepositAToken() (gas: 527804)
�[32m[PASS]�[0m test_metaDepositATokenUnderlying() (gas: 464103)
�[32m[PASS]�[0m test_metaDepositATokenUnderlyingNoPermit() (gas: 437241)
�[32m[PASS]�[0m test_metaWithdraw() (gas: 561424)
Test result: �[32mok�[0m. 5 passed; 0 failed; finished in 164.63ms
Running 29 tests for tests/StaticATokenLM.t.sol:StaticATokenLMTest
�[32m[PASS]�[0m testAdmin() (gas: 21480)
�[32m[PASS]�[0m testFail_claimRewardsOnBehalfOf() (gas: 706588)
�[32m[PASS]�[0m testFail_mintAboveBalance() (gas: 491657)
�[32m[PASS]�[0m testFail_redeemAboveBalance() (gas: 682378)
�[32m[PASS]�[0m testFail_redeemOverflowAllowance() (gas: 716374)
�[32m[PASS]�[0m testFail_withdrawAboveBalance() (gas: 908526)
�[32m[PASS]�[0m test_claimRewards() (gas: 642147)
�[32m[PASS]�[0m test_claimRewardsToSelf() (gas: 640788)
�[32m[PASS]�[0m test_collectAndUpdateRewards() (gas: 604329)
�[32m[PASS]�[0m test_convertersAndPreviews() (gas: 51146)
�[32m[PASS]�[0m test_depositATokenClaimWithdrawClaim() (gas: 786699)
�[32m[PASS]�[0m test_depositWETHClaimWithdrawClaim() (gas: 786715)
�[32m[PASS]�[0m test_getUnclaimedRewards() (gas: 610986)
�[32m[PASS]�[0m test_getters() (gas: 52202)
�[32m[PASS]�[0m test_maxDepositUnderlying_20kCap() (gas: 101237)
�[32m[PASS]�[0m test_maxDepositUnderlying_50kCap() (gas: 123844)
�[32m[PASS]�[0m test_maxDepositUnderlying_freeze() (gas: 89161)
�[32m[PASS]�[0m test_maxDepositUnderlying_noCap() (gas: 89867)
�[32m[PASS]�[0m test_maxDepositUnderlying_paused() (gas: 85984)
�[32m[PASS]�[0m test_maxRedeemUnderlying_allAvailable() (gas: 550896)
�[32m[PASS]�[0m test_maxRedeemUnderlying_nonAvailable() (gas: 1007547)
�[32m[PASS]�[0m test_maxRedeemUnderlying_partAvailable() (gas: 1025544)
�[32m[PASS]�[0m test_maxRedeemUnderlying_paused() (gas: 572620)
�[32m[PASS]�[0m test_mint() (gas: 560695)
�[32m[PASS]�[0m test_redeem() (gas: 607500)
�[32m[PASS]�[0m test_redeemAllowance() (gas: 668718)
�[32m[PASS]�[0m test_redeemUnderlying() (gas: 619475)
�[32m[PASS]�[0m test_transfer() (gas: 901362)
�[32m[PASS]�[0m test_withdraw() (gas: 611304)
Test result: �[32mok�[0m. 29 passed; 0 failed; finished in 137.39ms
Running 3 tests for tests/StaticATokenNoLM.t.sol:StaticATokenNoLMTest
�[32m[PASS]�[0m testAdmin() (gas: 21414)
�[32m[PASS]�[0m test_claimRewardsToSelfWithLMDisabled() (gas: 490400)
�[32m[PASS]�[0m test_collectAndUpdateRewardsWithLMDisabled() (gas: 491800)
Test result: �[32mok�[0m. 3 passed; 0 failed; finished in 365.04ms |
sakulstra
reviewed
Apr 16, 2024
sakulstra
approved these changes
May 6, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
RefreshRewardsRobot:
Chainlink automation compatible robot to automate refreshing rewards for static-a-token whenever a new LM reward has been added to an aToken.
When a reward is added after static-a-token creation, it needs to be registered manually on the token via the permissionless
refreshRewardTokens()method. As this process is not currently automated users might be missing out on rewards until the method is called, so now we aim to automate this process.Gas Capped Refresh Rewards Robot:
Similar to the refresh reward robot with an additional functionality of executing actions only when the current network gas price is under the configured gas price. The robot uses chainlink fast-gas feed to fetch the current network gas prices. Since chainlink fast-gas feed is currently only available on mainnet, the gas-capped robots will be used only on ethereum.
Gelato Gas Capped Refresh Rewards Robot:
Extending the gas capped refresh reward robots which is used to limit the execution on actions based on network gas prices, Gelato Gas Capped Robots is intended to be used via Gelato functions. The major difference from Gas Capped Refresh Rewards Robot which is used on chainlink automation is that on Gelato Gas Capped Robots we use
tx.gaspriceto fetch the current network gas price instead of the chainlink fast gas feed as Gelato natively supportstx.gaspricein their checker function.